package com.bidevalution.controller.api;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.bidevalution.business.service.BeSignLocationService;
import com.bidevalution.dao.entity.BeSignLocation;
import com.qtp.core.model.Response;

@RestController
@RequestMapping("/besignlocation")
public class BeSignLocationController {
	@Autowired
	private BeSignLocationService beSignLocationService;
	@RequestMapping(value = "/getlocations", method = RequestMethod.GET)
	public Response<List<BeSignLocation>> getOpenUrl( @RequestParam("sectionId") String sectionId) {

		return Response.ok(beSignLocationService.selectList(sectionId));
	}
	@RequestMapping(value = "/selectList", method = RequestMethod.GET)
	public Response<Map<String, Object>> selectList( @RequestParam("sectionId") String sectionId,@RequestParam("pageNo") Integer pageNo,@RequestParam("pageSize") Integer pageSize) {
		Map<String, Object> dataMap = new HashMap<String, Object>();
		dataMap.put("list", beSignLocationService.selectList(sectionId,pageNo, pageSize));
		dataMap.put("recordCount", beSignLocationService.selectCountForPage(sectionId));
		return Response.ok(dataMap);
	}

	
}
